package com.project.controller;

import com.project.entity.AssetStatus;
import com.project.service.AssetStatusService;
import com.project.util.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 资产状态控制器
 *
 * @author Leo高洋
 * @create 2023-03-03 16:07
 */
@RestController
@RequestMapping("/status")
public class AssetStatusController {
    @Autowired
    private AssetStatusService assetStatusService;

    private final static Logger logger = LoggerFactory.getLogger(AssetStatusController.class);

    @GetMapping("/list")
    public R list() {
        logger.info("查询所有的状态信息");
        List<AssetStatus> statusList = assetStatusService.list();
        Map<String, Object> resultMap = new HashMap<>();
        resultMap.put("statusList", statusList);
        return R.ok(resultMap);
    }
}
